import 'package:flutter/material.dart';
import 'package:ui_templates/app_theme.dart';

class SplashPage extends StatefulWidget {
  const SplashPage({super.key, required this.animationController});

  final AnimationController animationController;

  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage>
    with SingleTickerProviderStateMixin {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    // TODO: implement dispose
    widget.animationController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: SlideTransition(
      position: Tween(begin: const Offset(0, 0), end: const Offset(0, -1))
          .chain(CurveTween(curve: const Interval(0, 0.2)))
          .animate(widget.animationController),
      child: Container(
        color: const Color.fromRGBO(245, 235, 226, 1),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Container(
              width: double.infinity,
              child: Image.asset(
                "assets/introduction_animation/introduction_image.png",
                fit: BoxFit.contain,
              ),
            ),
            const SizedBox(height: 10),
            const Text(
              "Clear head",
              style: TextStyle(
                fontSize: 22,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(height: 10),
            const Padding(
              padding: EdgeInsets.symmetric(horizontal: 40.0),
              child: Text(
                "Lorem ipsum dolor sit amet,consecrate disciplining elit,sed do eiusmod tempor incididunt ut labore",
                textAlign: TextAlign.center,
              ),
            ),
            const SizedBox(height: 50),
            Container(
              width: 180,
              height: 60,
              child: ElevatedButton(
                style: ButtonStyle(
                  backgroundColor:
                      const MaterialStatePropertyAll<Color>(Colors.black),
                  shape: MaterialStatePropertyAll<RoundedRectangleBorder>(
                    RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(30),
                    ),
                  ),
                ),
                onPressed: () {
                  widget.animationController.animateTo(.2);
                },
                child: const Text(
                  "let's begin",
                  style: TextStyle(
                    fontSize: 20,
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    ));
  }
}
/*
*
* */
